# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libgsf
pkgver=1.14.49
pkgrel=0
pkgdesc="Utility library for reading and writing structured file formats"
url="https://www.gnome.org/"
arch="all"
license="LGPL-2.1-only"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
depends_dev="bzip2-dev"
makedepends="libxml2-dev glib-dev bzip2-dev intltool python3 zlib-dev
	gobject-introspection-dev"
source="https://download.gnome.org/sources/libgsf/1.14/libgsf-$pkgver.tar.xz"

# secfixes:
#   1.14.41-r0:
#     - CVE-2016-9888

build() {
	sed -i -e 's/gsf-gnome//' -e 's/thumbnailer//' Makefile.*
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--mandir=/usr/share/man \
		--disable-static \
		--without-gnome-vfs \
		--without-bonobo \
		--enable-introspection
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	rm -f "$pkgdir"/usr/share/man/man1/gsf-office-thumbnailer.1
}

sha512sums="
a847a3c7fe26865e110bb87cb7ed74c477fdaf41fdec1c97cd3ea85ab3ba2f618e609a38fb4087a2c9b58d8d4b430c2148c93cbbb8425af41b6c751efef3298e  libgsf-1.14.49.tar.xz
"
